import React from "react";
import { NavBar } from "antd-mobile";
import { useNavigate } from "react-router-dom";

export default function NavHeader(props) {
    const {title} = props
  const navigate = useNavigate();
  //  返回上一页
  const back = () => navigate(-1);

  return (
    <div className="nav-header">
      <NavBar onBack={back}>{title}</NavBar>
    </div>
  );
}
